/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.q1cc.cfs.jamp;

import java.awt.datatransfer.Transferable;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSourceContext;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.InvalidDnDOperationException;
/*
class DGListener implements DragGestureListener{

      public void dragGestureRecognized(DragGestureEvent dge){ // los, drag!
          try{
            Transferable t = getTransferableAt(DnDList.this.getSelectedIndex());
            dragSource.startDrag(dge, okCursor, t, sourceListener);
          }
          catch(InvalidDnDOperationException e){
            e.printStackTrace();
          }
      }
    }

class DSListener implements DragSourceListener{

      public void dragEnter(DragSourceDragEvent dse){ //darf das hierlang?
          DragSourceContext context = dse.getDragSourceContext();
          int action = dse.getDropAction();
          if((action & accept) == 0){ //falsche Aktion
            context.setCursor(noCursor);
          }
          else{
            context.setCursor(okCursor);
          }
      }

      public void dragOver(DragSourceDragEvent dse){ // oder hierdrueber
          dragEnter(dse);
      }

      public void dragExit(DragSourceEvent dse){ // raus gehts
      }

      public void dragDropEnd(DragSourceDropEvent dse){ // drag ist mit drop zuende
          if(dse.getDropSuccess() == false){//drop tat nicht
            return;
          }
          int action = dse.getDropAction();
          if((action & accept) == 0){ // falsche Aktion
            return;
          }
          try{
            Object data = dse.getDragSourceContext().getTransferable().getTransferData(localFlavor);
            if(data == null ||!(data instanceof String)){
                return;
            }
            removeItem(data); // das gedroppte hier loeschen
          }
          catch(Throwable t){
            t.printStackTrace();
          }
      }

      public void dropActionChanged(DragSourceDragEvent dse){ //z.B. ctrl loslassen
          dragEnter(dse); //ueberpruefen
      }
    }
*/